
#[macro_export]
macro_rules! glchk {
    ($glcall:stmt;) => {
        $glcall
        let err = gl::GetError();
        if err != gl::NO_ERROR {
            panic!("Open GL error({err}) at {}:{} caused by the call: {}", file!(), line!(), stringify!($glcall));
        }
    }
}

#[macro_export]
macro_rules! glchk_block {
    ($($glcall:stmt;)+) => {
        $(
            glchk!($glcall;);
        )*
    };
}